package imv3.protocol.codec;

import imv3.protocol.Packet;
import imv3.protocol.PacketCodec;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;

/**
 * @author @xsomnus666_xiawenye★
 * @since 2019-04-25 21:49
 * 既然选择了远方,便只顾风雨兼程
 */
public class PacketEncoder extends MessageToByteEncoder<Packet> {

    @Override
    protected void encode(ChannelHandlerContext ctx, Packet packet, ByteBuf out) {
        PacketCodec.INSTANCE.encode(out, packet);
    }

}
